package review;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class ArrDel {
    public static void main(String[] args) {
        String []ar={"apple","orange","banana","melon","pear","luobu"};
        Scanner in=new Scanner(System.in);
        System.out.println("To be del:");
        int index=in.nextInt();
        for(int i=index;i<ar.length-1;i++){
            ar[i]=ar[i+1];
        }
        ar[ar.length-1]=null;
        for (int i = 0; i <ar.length ; i++) {
            String a=ar[i];
            System.out.print("第"+i+"个是："+ar[i]+" ");
        }
        System.out.println();
        //增强for循环
        for(String a:ar){
            System.out.print(a+" ");
        }

    }
}
